<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>APP开发者平台 </title>

    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath }/statics/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="${pageContext.request.contextPath }/statics/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="${pageContext.request.contextPath }/statics/css/nprogress.css" rel="stylesheet">
    <!-- Custom Theme Style -->
    <link href="${pageContext.request.contextPath }/statics/css/custom.min.css" rel="stylesheet">
</head>

<body class="nav-md">
<input type="hidden" id="devUserName" value="${devUser.devName}">
<div class="container body">
    <div class="main_container">
        <div class="col-md-3 left_col">
            <div class="left_col scroll-view">
                <div class="navbar nav_title" style="border: 0;">
                    <a href="${pageContext.request.contextPath }/jsp/mainDeveloper.jsp" class="site_title"><i
                            class="fa fa-paw"></i> <span>APP
								BMS</span>
                    </a>
                </div>

                <div class="clearfix"></div>

                <!-- menu profile quick info -->
                <div class="profile">
                    <div class="profile_pic">
                        <img src="${pageContext.request.contextPath }/statics/images/img.jpg" alt="..."
                             class="img-circle profile_img">
                    </div>
                    <div class="profile_info">
                        <span>欢迎,</span>
                        <h2>${devUser.devName }</h2>
                    </div>
                </div>
                <!-- /menu profile quick info -->

                <br/>

                <!-- sidebar menu -->
                <div id="sidebar-menu"
                     class="main_menu_side hidden-print main_menu">
                    <div class="menu_section">
                        <h3>${devUser.devName }</h3>
                        <ul class="nav side-menu">
                            <li><a><i class="fa fa-home"></i> APP账户管理 <span
                                    class="fa fa-chevron-down"></span>
                            </a>
                                <ul class="nav child_menu">
                                    <li><a href="javascript:;">APP开发者账户申请</a>
                                    </li>
                                    <li><a href="javascript:;">个人账户信息维护</a>
                                    </li>
                                </ul>
                            </li>
                            <li><a><i class="fa fa-edit"></i> APP应用管理<span
                                    class="fa fa-chevron-down"></span>
                            </a>
                                <ul class="nav child_menu">
                                    <li>
                                        <a href="${pageContext.request.contextPath }/devShow">APP维护</a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </div>


                </div>
                <!-- /sidebar menu -->

                <!-- /menu footer buttons -->
                <div class="sidebar-footer hidden-small">
                    <a data-toggle="tooltip" data-placement="top" title="设置">
                        <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
                    </a> <a data-toggle="tooltip" data-placement="top" title="全屏幕">
                    <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
                </a> <a data-toggle="tooltip" data-placement="top" title="锁定"> <span
                        class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
                </a> <a data-toggle="tooltip" data-placement="top" title="退出"
                        href="${pageContext.request.contextPath }/signOut"> <span
                        class="glyphicon glyphicon-off" aria-hidden="true"></span> </a>
                </div>
                <!-- /menu footer buttons -->
            </div>
        </div>

        <!-- top navigation -->
        <div class="top_nav">
            <div class="nav_menu">
                <nav>
                    <div class="nav toggle">
                        <a id="menu_toggle"><i class="fa fa-bars"></i>
                        </a>
                    </div>

                    <ul class="nav navbar-nav navbar-right">
                        <li class=""><a href="javascript:;"
                                        class="user-profile dropdown-toggle" data-toggle="dropdown"
                                        aria-expanded="false"> <img
                                src="${pageContext.request.contextPath }/statics/images/img.jpg"
                                alt="">${devUserSession.devCode } <span
                                class=" fa fa-angle-down"></span> </a>
                            <ul class="dropdown-menu dropdown-usermenu pull-right">
                                <li><a
                                        href="${pageContext.request.contextPath }/signOut"><i
                                        class="fa fa-sign-out pull-right"></i> 退出</a>
                                </li>
                            </ul>
                        </li>

                    </ul>
                </nav>
            </div>
        </div>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main" style="min-height: 938px;">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div>
                                <span style="color: black">APP信息管理维护<span class="fa fa-user"></span></span>
                                ${devUser.devName}-您可以通过搜索或者其他的筛选项对APP的信息进行修改、删除等管理操作。^_^
                            </div>
                            <div class="x_title">
                                <ul class="nav navbar-right panel_toolbox">
                                </ul>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content" style="display: block;">
                                <form method="post" action="${pageContext.request.contextPath }/devShow">
                                    <div style="padding: 0px 100px;white-space: nowrap">
                                        <span>
                                            <span>软件名称</span>
                                            <input type="text" name="softwareName" id="appName">
                                        </span>
                                        <span style="position: relative;left: 20%">
                                            <span>APP状态</span>
                                            <select style="width: 176px;height: 25.11px" name="status"
                                                    id="status">
                                                <option value=>--请选择--</option>
                                                <option>待审核</option>
                                                <option>审核已通过</option>
                                                <option>审核未通过</option>
                                                <option>已上架</option>
                                                <option>已下架</option>
                                            </select>
                                        </span>
                                        <span style="float: right;">
                                            <span>所属平台</span>
                                            <select style="width: 176px;height: 25.11px" selected name="flatForm"
                                                    id="flatForm">
                                                <c:if test="${flatForm != null}">
                                                    <option selected value="${flatForm}">${flatForm}</option>
                                                </c:if>
                                                <option value=>--请选择--</option>
                                                <option>手机</option>
                                                <option>平板</option>
                                                <option>通用</option>
                                            </select>
                                        </span>
                                    </div>
                                    &nbsp;
                                    <div style="padding: 0px 100px;white-space: nowrap">
                                        <span>
                                            <span>一级分类</span>
                                            <select style="width: 176px;height: 25.11px" selected name="categoryName1"
                                                    id="categoryName1">
                                                <option value=>--请选择--</option>
                                                <option value="1">全部应用</option>
                                                <option value="2">全部游戏</option>
                                            </select>
                                        </span>
                                        <span style="position: relative;left: 20%">
                                            <span>二级分类</span>
                                            <select style="width: 176px;height: 25.11px" name="categoryName2"
                                                    id="categoryName2">
                                            </select>
                                        </span>
                                        <span style="float: right;">
                                            <span>三级分类</span>
                                            <select style="width: 176px;height: 25.11px" name="categoryName3"
                                                    id="categoryName3">
                                            </select>
                                        </span>
                                    </div>
                                    &nbsp;
                                    <div style="padding: 0px 100px;">
                                        <button type="submit" class="btn btn-default" _msthash="2661139"
                                                _msttexthash="94419">查询
                                        </button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <a href="${pageContext.request.contextPath }/jsp/addAppInformation.jsp"><button type="button" class="btn btn-success btn-lg">新增APP基础信息</button></a>
                            <table class="table table-striped table-bordered" style="border: 1px">
                                <tr style="height: 85px">
                                    <th>软件名称</th>
                                    <th>APK名称</th>
                                    <th>软件大小(单位:M)</th>
                                    <th>所属平台</th>
                                    <th>所属分类(一级分类、二级分类、三级分类)</th>
                                    <th id="appStatus">状态</th>
                                    <th>下载次数</th>
                                    <th>最新版本号</th>
                                    <th>操作</th>
                                </tr>
                                <c:forEach var="a" items="${appInfoList}">
                                    <tr style="height: 85px">
                                        <td>${a.softwareName}</td>
                                        <td>${a.APKName}</td>
                                        <td>${a.softwareSize}</td>
                                        <td>${a.flatForm}</td>
                                        <td>${a.categoryName1}->${a.categoryName2}->${a.categoryName3}</td>
                                        <td id="appStatus${a.id}">${a.appStatus}</td>
                                        <td>${a.downloads}</td>
                                        <td>${a.versionNo}</td>
                                        <td>
                                            <div class="btn-group">
                                                <button type="button" class="btn btn-danger">点击操作</button>
                                                <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false" style="height: 36.047px;">
                                                    <span class="caret"></span>
                                                    <span class="sr-only"></span>
                                                </button>
                                                <ul class="dropdown-menu" role="menu">
                                                    <li><a href="${pageContext.request.contextPath }/appVersionShow?appId=${a.id}" title="新增版本信息">新增版本</a>
                                                    </li>
                                                    <li><a href="javascript:;" class="modifyAppVersion" appStatus="${a.appStatus}" appId="${a.id}" title="修改版本信息">修改版本</a>
                                                    </li>
                                                    <li><a href="javascript:;" class="modifyApp" appStatus="${a.appStatus}" appId="${a.id}" title="修改app基础信息">修改</a>
                                                    </li>
                                                    <li><a href="${pageContext.request.contextPath }/seeApp?id=${a.id}" title="查看app详细信息">查看</a>
                                                    </li>
                                                    <li><a href="javascript:;" class="deleteApp" softwareName="${a.softwareName}" appId="${a.id}" title="删除app基础信息以及全部版本信息">删除</a>
                                                    </li>
                                                    <li><a href="javascript:;" class="putOnApp" appStatus="${a.appStatus}" appId="${a.id}" title="app上架">上架</a>
                                                    </li>
                                                    <li><a href="javascript:;" class="offOnApp" appStatus="${a.appStatus}" appId="${a.id}" title="app下架">下架</a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </table>
                        </div>
                        <input type="hidden" name="pageIndex" value="1">
                        <div>
                            <span>共${pageInfo.total}条记录  ${pageInfo.pageNum}/${pageInfo.pages}页</span>
                            <span style="float: right">
                                <a href="${pageContext.request.contextPath }/devShow?softwareName=${softwareName}&status=${status}&flatForm=${flatForm}&categoryName1=${categoryName1}&categoryName2=${categoryName2}&categoryName3=${categoryName3}">首页</a>
                                <a href="${pageContext.request.contextPath }/devShow?pageIndex=${pageInfo.hasPreviousPage?pageInfo.prePage:1}&softwareName=${softwareName}&status=${status}&flatForm=${flatForm}&categoryName1=${categoryName1}&categoryName2=${categoryName2}&categoryName3=${categoryName3}">上一页</a>
                                <a href="${pageContext.request.contextPath }/devShow?pageIndex=${pageInfo.hasNextPage?pageInfo.nextPage:pageInfo.pages}&softwareName=${softwareName}&status=${status}&flatForm=${flatForm}&categoryName1=${categoryName1}&categoryName2=${categoryName2}&categoryName3=${categoryName3}">下一页</a>
                                <a href="${pageContext.request.contextPath }/devShow?pageIndex=${pageInfo.pages}&softwareName=${softwareName}&status=${status}&flatForm=${flatForm}&categoryName1=${categoryName1}&categoryName2=${categoryName2}&categoryName3=${categoryName3}">最后一页</a>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /page content -->

        <!-- footer content -->
        <footer>
            <div class="pull-right">
                Gentelella - Bootstrap Admin Template by <a href="https://colorlib.com">Colorlib</a>
            </div>
            <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
    </div>
</div>
<input type="hidden" value="${appId}" id="appId" name="appId">
<%@include file="/jsp/common/js.jsp" %>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/maintainDeveloper.js"></script>
</body>
</html>